package cn.edu.scau.cmi.chenyuanying.orm.hibernate;

import org.hibernate.SessionFactory;
import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
import org.hibernate.cfg.Configuration;

public class HibernateSessionFactory {
	
	private static SessionFactory sessionFactory = null;
	private static Configuration cfg = new Configuration().configure();
	
	public static SessionFactory getSessionFactory() {
		if(sessionFactory == null) sessionFactory = cfg.buildSessionFactory();
		return sessionFactory;
	}
	
}
